@extends('plugin.hostserver.front.layout.base')
@section('add_css')
    <style>
    	#icon_select_all.fa{
			color:#81878c;
			cursor: pointer;
		}
		#icon_select_all.fa.fa-check{
			color: #6aaf08 !important;
		}
        .all_tlds_content_item i.fa.fa-check{
            color: #6aaf08 !important;
        }
        #all_tlds_wrap_id {

            overflow: hidden;
            position: relative;
            z-index: 0;
            padding: 24px 10px;
            width: 100%;
        }

        #all_tlds_wrap_id.has_max_height {
            max-height: 410px;
        }

        .all_tlds_content_item {
            color: #878d91;
            float: left;
            margin: 0 12px;
            width: 107px;
            height: 42px;
            line-height: 42px;
        }

        .all_tlds_content_item i.fa {
            width: 19px;
            color: #81878c;
            cursor: pointer;
        }

        .all_tlds_content_item i.fa.fa-check {
            color: #00aef9;
        }
        #show_more_warp_id {
            position: absolute;
            height: 60px;
            background-color: #fff;
            width: 100%;
            bottom: 0;
            z-index: 1;
            left: 0;
        }

        #show_more_warp_id hr {
            margin-top: 10px;
            width: 80%;
            margin-bottom: 18px;
        }
    </style>
@endsection
@section('content')
    <div id="" class="HeaderAdjust" data-bg-src=""
         style="background-image: url(&quot;&quot;); margin-top: 190.313px;">
        <div class="container">
            <div class="row">
                <div class="col-md-6 col-md-offset-3">
                    <div class="section-title">

                    </div>

                </div>
            </div>
        </div>
    </div>
    @include('plugin.hostserver.front.domain.search_box2',['no_title'=>1])

    <div class="container">
        <div class="has_max_height" id="all_tlds_wrap_id"
             style="">
            <div id="all_tlds_wrap2_id" style="width:100%;float:left;padding-bottom: 60px;">
                <div id="show_more_warp_id">
                    <div class="container " style="width:100%;">
                        <hr>
                        <div class="show_more" id="show_more_id"
                             style="width: 100px;font-size: 16px;margin: 0 auto; color: #6aaf08;cursor: pointer">显示更多&nbsp;+
                        </div>
                    </div>
                </div>
                <div id="orders_wrap_id"
                     class="com_com,net_net,org_org,co_co,life_life,us_us,me_me,today_today,design_design,tech_tech,xyz_xyz,eu_eu,biz_biz,pro_pro,fun_fun,info_info,club_club,in_in,moe_moe,global_global,top_top,la_la,online_online,site_site,store_store,im_im,gdn_gdn,mx_mx,tv_tv,io_io,mobi_mobi,co.uk_co.uk,tel_tel,cc_cc,cam_cam,one_one,cn_cn,blog_blog,live_live,asia_asia,shop_shop,vip_vip,space_space,ws_ws,link_link,games_games,닷컴_xn--mk1bu44c,work_work,lat_lat,닷넷_xn--t60b56a,コム_xn--tckwe,website_website,sucks_sucks,uk_uk,sx_sx,press_press,fund_fund,bet_bet,sex_sex,中国_xn--fiqs8s,vc_vc,social_social,porn_porn,xxx_xxx,run_run,gold_gold,sexy_sexy,click_click,ninja_ninja,earth_earth,red_red,name_name,family_family,win_win,news_news,rocks_rocks,adult_adult,vin_vin,osaka_osaka,ca_ca,wine_wine,de_de,cloud_cloud,rent_rent,pub_pub,co.in_co.in,stream_stream,mba_mba,org.in_org.in,com.mx_com.mx,com.cn_com.cn,ooo_ooo,pw_pw,be_be,so_so,在线_xn--3ds443g,at_at,ren_ren,guru_guru,world_world,forsale_forsale,pizza_pizza,group_group,nyc_nyc,limited_limited,network_network,help_help,toys_toys,lt_lt,sc_sc,nl_nl,bz_bz,中文网_xn--fiq228c5hs,pl_pl,fm_fm,ph_ph,lc_lc,uno_uno,singles_singles,graphics_graphics,diet_diet,com.co_com.co,kaufen_kaufen,business_business,org.uk_org.uk,vision_vision,software_software,deals_deals,band_band,公司_xn--55qx5d,vegas_vegas,wang_wang,reviews_reviews,holdings_holdings,domains_domains,discount_discount,city_city,market_market,events_events,media_media,clothing_clothing,tips_tips,photography_photography,organic_organic,mn_mn,ag_ag,bike_bike,plumbing_plumbing,ventures_ventures,camera_camera,equipment_equipment,estate_estate,gallery_gallery,lighting_lighting,contractors_contractors,land_land,technology_technology,construction_construction,directory_directory,kitchen_kitchen,diamonds_diamonds,enterprises_enterprises,voyage_voyage,shoes_shoes,careers_careers,photos_photos,recipes_recipes,limo_limo,cab_cab,company_company,computer_computer,center_center,systems_systems,academy_academy,management_management,menu_menu,berlin_berlin,training_training,solutions_solutions,support_support,builders_builders,email_email,education_education,institute_institute,repair_repair,camp_camp,glass_glass,ruhr_ruhr,ceo_ceo,solar_solar,coffee_coffee,international_international,house_house,florist_florist,みんな_xn--q9jyb4c,holiday_holiday,marketing_marketing,rich_rich,tattoo_tattoo,buzz_buzz,gift_gift,guitars_guitars,pics_pics,photo_photo,viajes_viajes,farm_farm,codes_codes,onl_onl,pink_pink,shiksha_shiksha,boutique_boutique,kim_kim,blue_blue,移动_xn--6frz82g,cheap_cheap,zone_zone,build_build,cool_cool,watch_watch,kiwi_kiwi,agency_agency,bargains_bargains,actor_actor,best_best,dance_dance,wien_wien,wiki_wiki,works_works,expert_expert,luxury_luxury,democrat_democrat,immobilien_immobilien,futbol_futbol,moda_moda,foundation_foundation,exposed_exposed,vacations_vacations,villas_villas,flights_flights,rentals_rentals,cruises_cruises,condos_condos,tienda_tienda,properties_properties,maison_maison,nagoya_nagoya,productions_productions,partners_partners,dating_dating,bid_bid,trade_trade,webcam_webcam,qpon_qpon,archi_archi,consulting_consulting,cards_cards,catering_catering,cleaning_cleaning,community_community,parts_parts,industries_industries,supplies_supplies,supply_supply,tools_tools,tokyo_tokyo,christmas_christmas,net.in_net.in,ind.in_ind.in,gen.in_gen.in,firm.in_firm.in,net.cn_net.cn,org.cn_org.cn,me.uk_me.uk,net.co_net.co,nom.co_nom.co,com.pl_com.pl,net.pl_net.pl,org.pl_org.pl,info.pl_info.pl,biz.pl_biz.pl,co.at_co.at,or.at_or.at,com.so_com.so,net.so_net.so,org.so_org.so,com.ph_com.ph,net.ph_net.ph,org.ph_org.ph,com.im_com.im,co.im_co.im,net.im_net.im,org.im_org.im,com.bz_com.bz,co.bz_co.bz,net.bz_net.bz,org.bz_org.bz,l.lc_l.lc,p.lc_p.lc,com.lc_com.lc,net.lc_net.lc,org.lc_org.lc,com.vc_com.vc,net.vc_net.vc,org.vc_org.vc,com.sc_com.sc,net.sc_net.sc,org.sc_org.sc,com.ag_com.ag,co.ag_co.ag,net.ag_net.ag,org.ag_org.ag,nom.ag_nom.ag,koeln_koeln,university_university,taxi_taxi,career_career,fail_fail,vet_vet,cricket_cricket,wtf_wtf,hosting_hosting,cymru_cymru,haus_haus,money_money,auction_auction,plus_plus,soccer_soccer,claims_claims,vodka_vodka,scot_scot,jetzt_jetzt,creditcard_creditcard,pet_pet,mortgage_mortgage,rehab_rehab,bio_bio,loan_loan,church_church,reisen_reisen,country_country,tube_tube,associates_associates,financial_financial,horse_horse,moscow_moscow,surgery_surgery,coupons_coupons,gifts_gifts,chat_chat,faith_faith,sale_sale,shopping_shopping,app_app,网站_xn--5tzm5g,host_host,wales_wales,tours_tours,okinawa_okinawa,black_black,gmbh_gmbh,memorial_memorial,schule_schule,surf_surf,gratis_gratis,bingo_bingo,accountants_accountants,taipei_taipei,furniture_furniture,dentist_dentist,capital_capital,juegos_juegos,coach_coach,bar_bar,ac_ac,finance_finance,auto_auto,hospital_hospital,网络_xn--io0a7i,style_style,download_download,yokohama_yokohama,immo_immo,promo_promo,garden_garden,digital_digital,party_party,cologne_cologne,miami_miami,desi_desi,attorney_attorney,beer_beer,eco_eco,investments_investments,lease_lease,direct_direct,movie_movie,how_how,doctor_doctor,republican_republican,tickets_tickets,poker_poker,ngo_ngo,sh_sh,ltd_ltd,casino_casino,tennis_tennis,gripe_gripe,dental_dental,rip_rip,clinic_clinic,london_london,science_science,voting_voting,fashion_fashion,accountant_accountant,energy_energy,fans_fans,car_car,restaurant_restaurant,property_property,show_show,salon_salon,dog_dog,fish_fish,fishing_fishing,exchange_exchange,商店_xn--czrs0t,fitness_fitness,mom_mom,pictures_pictures,audio_audio,cx_cx,review_review,yoga_yoga,fyi_fyi,express_express,loans_loans,guide_guide,apartments_apartments,services_services,love_love,art_art,school_school,army_army,football_football,cars_cars,企业_xn--vhquv,report_report,reise_reise,studio_studio,team_team,healthcare_healthcare,golf_golf,racing_racing,place_place,town_town,cafe_cafe,flowers_flowers,blackfriday_blackfriday,quebec_quebec,game_game,tires_tires,ski_ski,rodeo_rodeo,lgbt_lgbt,date_date,engineer_engineer,green_green,men_men,navy_navy,casa_casa,lawyer_lawyer,hiphop_hiphop,wedding_wedding,credit_credit,soy_soy,irish_irish,video_video,college_college,ink_ink,游戏_xn--unup4y,care_care,legal_legal,insure_insure,engineering_engineering,sarl_sarl,airforce_airforce,hockey_hockey,delivery_delivery,cooking_cooking,fit_fit,jewelry_jewelry,rest_rest,degree_degree,gives_gives,lol_lol,theater_theater,世界_xn--rhqv96g,娱乐_xn--fjq720a,tax_tax,cash_cash,vote_vote,voto_voto,ею_xn--e1a4c,boston_boston,com.pr_com.pr,boats_boats,biz.pr_biz.pr,name.pr_name.pr,pr_pr,info.pr_info.pr,pro.pr_pro.pr,org.pr_org.pr,isla.pr_isla.pr,net.pr_net.pr,org.lv_org.lv,inc_inc,autos_autos,fan_fan,page_page,monster_monster,com.lv_com.lv,asn.lv_asn.lv,motorcycles_motorcycles,dev_dev,קום_xn--9dbq2a,luxe_luxe,ai_ai,id.lv_id.lv,charity_charity,llc_llc,baby_baby,travel_travel,net.lv_net.lv,yachts_yachts,realestate_realestate,conf.lv_conf.lv,health_health,icu_icu,homes_homes,lv_lv,bond_bond,ευ_xn--qxa6a">
                    <i class="fa fa-plus" id="icon_select_all"
                       style="float:left;line-height:1.5;margin-right:10px;"></i><span
                            style="margin-right: 15px;float:left;cursor: pointer" id="order_all_id">全选</span></div>
                <hr id="order_default_hr" style="width:80%;">

                <div id="all_tlds_content_id" style="float:left;width:100%;">
                    @php


                            @endphp
                    @if(!empty($domains))
                        @foreach($domains as $k=>$v)
                            <div class="all_tlds_content_item"><i class="fa {{ $k<10?'fa-check':'fa-plus' }}"
                                                                  tld-puny="{{ $v['name'] }}"></i><span class="tld_text"
                                                                                                        style="cursor:pointer;">{{ $v['name'] }}</span>
                            </div>
                        @endforeach
                    @endif

                </div>
            </div>
        </div>
    </div>

    <div id="pricingTable2" class="domains-page ss-so" style="display: none">
        <div class="container">
            <!-- Section Title Start -->


            <table>
                <thead>
                <tr>
                    <th>域名</th>
                    <th>1 年</th>
                    <th>2 年</th>
                    <th>3 年</th>
                    <td>操作</td>

                </tr>
                </thead>
                <tbody id="domainShow">


                </tbody>
                <tfoot>
                <tr>
                    <td colspan="5"><a href="javascript:void(0)" data-domain="{{ $domain }}" data-page="1"
                                       class="btn btn-info ajax-domain" style="background: #6aaf08;color: #fff">查看更多</a></td>
                </tr>
                </tfoot>
            </table>


        </div>
    </div>

@endsection
@section('foot_js')
    <script>
        page = 0;

        function searchDomain(page, domain) {
            var do_toast = msgToast('查询中...', 0, 'loading');

            var ext = $(".all_tlds_content_item .fa-check");
            ext_arr = []
            ext.each(function () {
                ext_arr.push($(this).attr('tld-puny'))
            });

            console.log(ext);
            ajax(urlConfigApi.domainSearch, {page: page, domain: domain, ext: ext_arr.join(',')}, function (res) {
                do_toast.close();
                if (res.code == 200) {

                    $("#domainShow").append(res.data);
                    $(".ajax-domain").show();
                }
                else {

                    $(".ajax-domain").hide();

                    msg('没有更多了')
                }
            }, function () {
                msg('当前查询人数过多，请稍后再试');
            }, function () {
                do_toast.close();

            }, '', '', 1)
        }

        var domain = "{{ request()->input('domain') }}";


        $(function () {
            if (domain) {
                page=1;
                $("#domainShow").empty();
                searchDomain(1, domain);
                $(".ss-so").show();
            }
            $(document).on("click", ".ajax-domain", function () {
                var that = $(this);
                page++;
                searchDomain(page, $("#domainKey").val())

            })
            //搜索
            $(document).on("click", ".ajax-search", function () {
                var that = $(this);
                var key = $("#domainKey").val();
                page = 1;
                $("#domainShow").empty();
                searchDomain(page, key)

                $(".ss-so").show();


            })
            $("#show_more_id").click(function () {
                $("#all_tlds_wrap_id").toggleClass('has_max_height');
                if ($("#all_tlds_wrap_id").hasClass('has_max_height')) {
                    $(this).text('查看更多');
                } else {
                    $(this).text('关闭更多');
                }

            })
            //选中
            $(".all_tlds_content_item").click(function () {
                var fa = $(this).find('.fa');
                if (fa.hasClass('fa-check')) {
                    fa.addClass('fa-plus');
                    fa.removeClass('fa-check');

                } else {
                    fa.addClass('fa-check');
                    fa.removeClass('fa-plus');
                }

            })
            //全选
            $("#order_all_id").click(function(){

                if($(this).hasClass('on'))
                {
                    $(".all_tlds_content_item .fa").removeClass('fa-check').addClass('fa-plus');
                    $('#icon_select_all').removeClass('fa-check').addClass('fa-plus');
                }else{
                    $(".all_tlds_content_item .fa").removeClass('fa-plus').addClass('fa-check');
                    $('#icon_select_all').removeClass('fa-plus').addClass('fa-check');
                }
                $(this).toggleClass('on');

            })
            //icon_select_all
            $("#icon_select_all").click(function(){

                if($("#order_all_id").hasClass('on'))
                {
                    $(".all_tlds_content_item .fa").removeClass('fa-check').addClass('fa-plus');
                    $(this).removeClass('fa-check').addClass('fa-plus');
                }else{
                    $(".all_tlds_content_item .fa").removeClass('fa-plus').addClass('fa-check');
                    $(this).removeClass('fa-plus').addClass('fa-check');
                }
                $("#order_all_id").toggleClass('on');

            })
        })
    </script>
@endsection